<%@ Page Language="C#" CodeFile="MyBooks.aspx.cs" Inherits="MyBooks" Theme="Default" EnableTheming="true"
    MasterPageFile="~/Site.master"  Title="Dr. Yurttas' Office Library &mdash; My Books" %>
<asp:Content ID="ContentAdmin" ContentPlaceHolderID="MasterContentAdmin" Runat="Server">
    <asp:LoginView ID="LoginViewAdmin" runat="server">
        <RoleGroups>
            <asp:RoleGroup Roles="admin">
                <ContentTemplate>
                    You are an administrator, you do not need to check out books.
                </ContentTemplate>
            </asp:RoleGroup>
        </RoleGroups>
    </asp:LoginView>                       
</asp:Content>
<asp:Content ID="ContentUser" ContentPlaceHolderID="MasterContentUser" Runat="Server">
    <asp:LoginView ID="LoginViewUser" runat="server">
        <RoleGroups>
            <asp:RoleGroup Roles="user">
                <ContentTemplate>
                    Hello <span class="myname"><asp:LoginName runat="server" ID="myName" /></span>, 
                    you have requested the following books.
                    <br /><br />   
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" DataSourceID="SqlDataSource1"
                        AutoGenerateColumns="False" AutoGenerateEditButton="False" AutoGenerateDeleteButton="False" 
                        AllowSorting="True" DataKeyNames="requestid">
                        <Columns>
                            <asp:BoundField DataField="requestid" HeaderText="Request ID" SortExpression="requestid" />
                            <asp:BoundField DataField="bookid" HeaderText="ISBN" SortExpression="bookid" />
                            <asp:HyperLinkField DataTextField="shortTitle" 
                                DataNavigateUrlFormatString="http://www.amazon.com/gp/product/{0}" 
                                DataNavigateUrlFields="bookid" HeaderText="Title" SortExpression="title" />
                        </Columns>
                    </asp:GridView>

                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:sylib %>" SelectCommand="" >
                    </asp:SqlDataSource>
                </ContentTemplate>
            </asp:RoleGroup>
        </RoleGroups>
    </asp:LoginView>                       
</asp:Content>
<asp:Content ID="ContentAnonymous" ContentPlaceHolderID="MasterContentAnonymous" Runat="Server">
    <asp:LoginView ID="LoginViewAnonymous" runat="server">
        <AnonymousTemplate>
            Please register or login before requesting service.
        </AnonymousTemplate>
    </asp:LoginView>                       
</asp:Content>